package org.dp.leeCode0062;

/**
 * @author wangjingyu
 */
public class Solution {

    public static void main(String[] args) {

        Solution solution=new Solution();
        System.out.println(solution.uniquePaths(3,7));

    }

    public int uniquePaths(int m, int n) {

        int[][] ints=new int[m][n];

        for(int i=0;i<m;i++){
            ints[i][0]=1;
        }
        for (int j=0;j<n;j++){
            ints[0][j]=1;
        }
        for (int x=1;x<m;x++){
            for (int y=1;y<n;y++){
                ints[x][y]=ints[x][y-1]+ints[x-1][y];
            }
        }
        return ints[m-1][n-1];

    }

}
